package com.lrkj.workorder.service.impl;

import java.util.List;

import com.lrkj.common.core.domain.entity.SysUser;
import com.lrkj.common.utils.DateUtils;
import com.lrkj.common.utils.SecurityUtils;
import com.lrkj.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lrkj.workorder.mapper.WorkOrderLogMapper;
import com.lrkj.workorder.domain.WorkOrderLog;
import com.lrkj.workorder.service.IWorkOrderLogService;

/**
 * 工单日志Service业务层处理
 *
 * @author yajun_ren
 * @date 2022-04-25
 */
@Service
public class WorkOrderLogServiceImpl implements IWorkOrderLogService
{
    @Autowired
    private WorkOrderLogMapper workOrderLogMapper;

    /**
     * 查询工单日志
     *
     * @param id 工单日志ID
     * @return 工单日志
     */
    @Override
    public WorkOrderLog selectWorkOrderLogById(String id)
    {
        return workOrderLogMapper.selectWorkOrderLogById(id);
    }

    /**
     * 查询工单日志列表
     *
     * @param workOrderLog 工单日志
     * @return 工单日志
     */
    @Override
    public List<WorkOrderLog> selectWorkOrderLogList(WorkOrderLog workOrderLog)
    {
        return workOrderLogMapper.selectWorkOrderLogList(workOrderLog);
    }

    /**
     * 新增工单日志
     *
     * @param workOrderLog 工单日志
     * @return 结果
     */
    @Override
    public int insertWorkOrderLog(WorkOrderLog workOrderLog)
    {
        workOrderLog.setId(IdUtils.simpleUUID());
        workOrderLog.setOperationTime(DateUtils.getNowDate());
        return workOrderLogMapper.insertWorkOrderLog(workOrderLog);
    }

    /**
     * 修改工单日志
     *
     * @param workOrderLog 工单日志
     * @return 结果
     */
    @Override
    public int updateWorkOrderLog(WorkOrderLog workOrderLog)
    {
        return workOrderLogMapper.updateWorkOrderLog(workOrderLog);
    }

    /**
     * 批量删除工单日志
     *
     * @param ids 需要删除的工单日志ID
     * @return 结果
     */
    @Override
    public int deleteWorkOrderLogByIds(String[] ids)
    {
        return workOrderLogMapper.deleteWorkOrderLogByIds(ids);
    }

    /**
     * 删除工单日志信息
     *
     * @param id 工单日志ID
     * @return 结果
     */
    @Override
    public int deleteWorkOrderLogById(String id)
    {
        return workOrderLogMapper.deleteWorkOrderLogById(id);
    }
    /**
     * 批量新增工单日志信息
     *
     * @param workOrderLogs 工单日志对象
     */
    public int batchAddData(List<WorkOrderLog> workOrderLogs)
    {
           return workOrderLogMapper.batchAddData(workOrderLogs);
    }
}
